package leetcode;

/**
 * @author cino
 * justCode
 */
public class leetcode326 {

    public static void main(String[] args) {
        System.out.println(isPowerOfThree(4));
    }
    public static boolean isPowerOfThree(int n) {
        while(n!=0&&n%3==0){
            n/=3;
        }
        return n ==1;
    }
}
